package com.baidu.bulls.cat.demo.stock.catutils;

import com.sun.org.apache.regexp.internal.RE;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class CatFilterConfigure {
    /**
     * Cat过滤器的注册配置
     */
    @Bean
    public FilterRegistrationBean catFilter(){
        FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();
        CatServletFilter filter = new CatServletFilter();
        filterRegistrationBean.setFilter(filter);
        filterRegistrationBean.addUrlPatterns("/*");
        filterRegistrationBean.setName("cat-filter");
        filterRegistrationBean.setOrder(1);
        return  filterRegistrationBean;

    }
}
